﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using DG.Tweening;

public class LoginPanel : MonoBehaviour
{
    public GameObject LoginBtn;
    public GameObject RegisterBtn;
    public GameObject InputParent;

    public GameObject InterDucParent;
    public Text InterDuction;

    private GameObject go = null;
    private void Awake()
    {
      //  this.SetObjActive(this.InterDucParent, true);
       // this.ShowBtnAndInputFiled(false);
    }

    // Use this for initialization
    void Start ()
    {
        
    }
    [ContextMenu("DoInterDuctionAnim")]
    public void DoInterDuctionAnim()
    {
        InterDuction.text = string.Empty;
        string ts = "sdnasjkdhasdkhjklasndiaoshdklasndmashdjkasdlaskdhasjkhdjklasdhkjashdjkahsdajsdhjkashdjkashdjkashdjkasdhajkshdk";
        Tweener interDuction = InterDuction.DOText(ts,5).OnComplete(()=>
        {
            this.ShowBtnAndInputFiled(true);
            this.SetObjActive(this.InterDucParent, false);
        });

        
        
    }

    public void ShowBtnAndInputFiled(bool enable)
    {
        this.SetObjActive(LoginBtn, enable);
        this.SetObjActive(RegisterBtn, enable);
        this.SetObjActive(InputParent, enable);
    }

    public void SetObjActive(GameObject go,bool enable)
    {
        if (go == null) return;
        go.SetActive(enable);
    }

    public void OnLoginAndRegisetBtnClicked()
    {
        // go to mainPanel
       // string str = go.name;
        UIManager.Instance.CreateUIByName(UINameDef.MainPanel);
    }
    [ContextMenu("TestLoadConfig")]
    private void TestLoadConfig()
    {
        NewItemManager.Instance.LoadItemConfigData();
    }
        
}
